package cn.itsource.hrm.controller;

import cn.itsource.hrm.domain.User;
import cn.itsource.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenyuqi
 * @version v1.0.0
 * @date 2020/5/19
 */
@RestController
public class LoginController {
    @PostMapping("/login")
    public AjaxResult login(@RequestBody User user){
        if("chenyuqi".equals(user.getUsername())&&"123456".equals(user.getPassword())){
            return AjaxResult.me().setSuccess(true).setMessage("登陆成功").setResultObj(user);
        }else{
            return AjaxResult.me().setSuccess(false).setMessage("用户名或者密码错误");
        }
    }
}
